Skip to content

fix(binder): skip instances that left the game before their added signal ran - #873

Open
spoukyii wants to merge 1 commit into
Quenty:mainfrom
spoukyii:users/spoukyii/binder-skip-removed-instances
Open

spoukyii wants to merge 1 commit into
Quenty:mainfrom
spoukyii:users/spoukyii/binder-skip-removed-instances

Conversation

@spoukyii

Copy link
Copy Markdown

Binder now skips an instance whose deferred added signal runs after the instance was destroyed or removed. With deferred signals, a client can receive a tagged model that the server added and destroyed within one replication batch, and the binder constructed its class on the already-destroyed instance, so a constructor that reads the model's children errored; the new spec covers it.

Checked in a Studio Play run: a server that tags a Humanoid model and destroys it two frames later made the client construct on an instance with no parent and no children six times out of six, and with this change it constructed nothing and logged no error, while models that outlive that window still bind as before.

Bug: attempt to index nil with 'DisplayDistanceType'

…nal ran

With deferred signals, CollectionService's added signal can run after the
tagged instance was destroyed or removed, so the binder constructed its class
on an instance with no parent and no children, then unbound it at once. On a
client this happens whenever the server adds and destroys a tagged model
within one replication batch, and a constructor that reads the model's
children errors.

Bug: attempt to index nil with 'DisplayDistanceType'

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant